#!/bin/sh
# Copyright(c) 2011 OpenDomo Services SL. Licensed under GPL v3 or later

PIDFILE="/var/run/diskmanager.pid"

case "$1" in
	restart|reload)
		$0 stop
		echo
		$0 start
		echo
	;;
	start)
		echo -n "Starting disk manager ..."
		touch $PIDFILE
		/usr/bin/bgshell "/usr/local/bin/diskmanager.sh"
	;;
	stop)
		echo -n "Stoping disk manager ... "
		rm $PIDFILE 2>/dev/null
	;;
	status)
		if test -f "$PIDFILE"; then
			echo "service running"
		else
			echo "service disabled"
			exit 1
		fi
	;;
	*)
		echo "Usage: $0 {start|stop|restart|reload}"
		exit 1
	;;
esac

exit 0
